Demo for native extra fields usage#246
Open
Jeremie-Kiwik wants to merge 11 commits into
Open
Conversation
Jeremie-Kiwik
commented
Mar 25, 2026
| Questions | Answers |
|---|---|
| Description? | Add a demo module for extra fields usage on PrestaShop |
| Type? | new feature |
| BC breaks? | no |
| Deprecations? | no |
| Fixed ticket? | Example usage of PrestaShop/PrestaShop#41092 |
| Sponsor company | KIWIK |
| How to test? | See demoextrafield/README.md |
This was referenced Mar 25, 2026
jolelievre
reviewed
May 20, 2026
| $this->version = '1.0.0'; | ||
| $this->author = 'PrestaShop'; | ||
| $this->need_instance = 0; | ||
| $this->ps_versions_compliancy = ['min' => '9.1.0', 'max' => '9.9.99']; |
Contributor
There was a problem hiding this comment.
Suggested change
| $this->ps_versions_compliancy = ['min' => '9.1.0', 'max' => '9.9.99']; | |
| $this->ps_versions_compliancy = ['min' => '9.2.0', 'max' => '9.9.99']; |
- hookDisplayCustomerAccountTop passes the Customer ObjectModel directly to Smarty — no presenter, no array conversion; FO filtering is native - _extra_properties.tpl: first hop uses object syntax (works for both LazyArrays and raw ObjectModels via __get; ObjectModel is not ArrayAccess), empty-state handled with foreachelse (bags are objects, empty() cannot work) - category marketing_note registered with displayFront: false to validate FO filtering through the presenter LazyArray path (customer internal_note covers the native ObjectModel path)
- Register cms/promo_banner (LANG) and cms/revision_code (COMMON) without associatedForms: the module integrates them into the migrated CMS page form manually via actionCmsPageFormBuilderModifier (TranslatableType + TextType), actionCmsPageFormDataProviderData (prefill from the native multilang bag) and actionAfterCreate/UpdateCmsPageFormHandler - Persistence is the native ObjectModel multilang round-trip: new CMS($id) without langId loads [id_lang => value] arrays, all languages are assigned and saved in one $cms->update() - FO display via displayCMSDisputeInformation: CMS instantiated with the context langId (lang fields as scalars, FO-filtered bag) + named access through the ObjectPresenter-presented $cms global - Unregister all hooks on uninstall
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.